<?php
/**
 * This is the index.ctp of Property Controller
 * @author Gideon Amissah<kuulmek@yahoo.com>
 * @access public
 * @version 
 */

$prpGropOpt = array();
foreach($prpGroupData as $value){
    $prpGropOpt[$value['id']] = $value['group_name'];
}

$locOpt = array();
foreach($loc_data as $value){
    $locOpt[$value['id']] = $value['location_name'];
}


$loggedUser =  $this->Session->read('userSessionData');
$loggedUser_id = $loggedUser['id'];
$modified_date = date('Y-m-d H:i:s');
$created_date = date('Y-m-d H:i:s');

?>
<script type="text/javascript">
	var gblPrpGroup = <?php echo json_encode($jsonArr) ;?>;
    var gblPrpGroup = <?php echo json_encode($jsonArr) ;?>;
    var gblPrpGroupData = <?php echo json_encode($prpGroupData) ;?>;
    var gblLocData = <?php echo json_encode($locOpt) ;?>;
    var gblLocAreaCodeData = <?php echo json_encode($loc_data) ;?>;
</script>
<div class="property-pane" >
   <div class="pane-header">
       Property Report
   </div>
   
   <div id="config-details-box" class='report_filter' style="float:left; width: 20%; height: 350px; margin-right: 30px; padding: 10px 10px 10px 10px;">
    <div class="content">
        <ul id="report_type_accordion"> 
           <li><a href="#">Property Report</a>
              <ul> 
                   <li>
                         <div class="row">
                            <div class="label" style="float:left; margin-right: 40px; margin-bottom: 10px;">Select Location</div>
                		    <div class="data">
                            <?php echo $this->Form->input('location_id', array( 'div' => false, 'label' => false, 'id'=>'location_id', 'options' => $locOpt));?> 
                            </div>
                       </div> 
                   </li> 
              </ul> 
           </li> 
           <li><a href="#">Account Report</a> 
              <ul> 
                   <li style="height: 250px;">
                        <div class="row">
                		    <div class="data" style="margin: 0px 0px 10px 0px;">
                            <?php 
                                echo $this->Form->input('group_id', array('style'=>'width:100%;', 'div' => false, 'label' => false, 'id'=>'acct_group_id', 'options' => $jsonArr));
                            ?> 
                            </div>
                		    <div class="data" style="margin: 0px 0px 10px 0px;">
                            <?php 
                                echo $this->Form->input('location_id', array( 'div' => false, 'label' => false, 'id'=>'acct_location_id', 'options' => $locOpt));
                            ?> 
                            </div>
                		    <div class="data" style="margin: 0px 0px 10px 0px;">
                            <?php 
                                echo $this->Form->input('Report Type', array(
                                     'div' => false, 
                                     'label' => false,
                                     'type' => 'radio',
                                     'id' => 'acct_report_type',
                                     'name' => 'acct_report_type',
                                     'options' => array('debtors'=>'Debtors', 'revenue'=>'Revenue')
                                ));
                            ?>  
                            </div>
                            <div id="revenue_year_select" style="display: none; ">
                                <div class="label" style="margin: 10px 40px 10px 0px;">Select Year</div>
                    		    <div class="data" style="margin: 0px 0px 10px 0px;">
                                <?php 
                                    echo $this->Form->input('revenue_year', array( 'div' => false, 'label' => false, 'id'=>'revenue_year', 'options' => $bill_year_opt));
                                ?> 
                                </div>
                            </div>
                            <div class="data">
                                <button type="button" class="save" id="acct-report-btn">View</button>
                                <button type="button" class="save" id="print-acct-btn">&nbsp;Print</button>
                            </div>
                       </div> 
                   </li> 
              </ul> 
           </li> 
        </ul>
      </div>
   </div>
   
   <div id="config-details-box"  style="float:left; width: 72%; padding: 10px 10px 10px 10px;">
        <div class='report_views' style="margin-bottom: 10px;"></div>
        <div id='chart_views' ></div>
   </div>
   
   <div style="display: none;">
    <div id="property_colorbox" style="margin: 30px 20px 20px 20px;"></div>
   </div>
   
   <form id="popUpform" method="post" action="<?php echo $this->Html->url(array('controller' => 'Report', 'action' => 'printData')); ?>" target="PrintWindow">
    <input type="hidden" name="formIds" id="formIds" value="" />
    <input type="hidden" name="formTitle" id="formTitle"  value="" />
    <input type="hidden" name="formGroupid" id="formGroupid"  value="" />
    <input type="hidden" name="formLocationName" id="formLocationName"  value="" />
   </form>
      
</div>


<input type="hidden" id="get-data-url" value="<?php echo $this->Html->url(array('controller' => 'Report', 'action' => 'getData')); ?>" />
<input type="hidden" id="view-data-url" value="<?php echo $this->Html->url(array('controller' => 'Report', 'action' => 'viewData')); ?>" />
<input type="hidden" id="print-data-url" value="<?php echo $this->Html->url(array('controller' => 'Report', 'action' => 'printData')); ?>" />
<input type="hidden" id="print-revenue-debtor-url" value="<?php echo $this->Html->url(array('controller' => 'Report', 'action' => 'printRevenueDebtors')); ?>" />
